package com.yigerende.feign;

import com.yigerende.pojo.OrderVo;
import com.yigerende.pojo.TOrder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "WM-ORDER")
public interface OrderFeign {

    @PostMapping("/order/save")
    int save(@RequestBody TOrder TOrder);

    @GetMapping("/order/findAllByUid/{uid}/{page}/{limit}")
    OrderVo findAllByUid(@PathVariable("uid") Integer uid, @PathVariable("page") Integer page, @PathVariable("limit") Integer limit);

    @DeleteMapping("/order/deleteByMid/{mid}")
    int deleteByMid(@PathVariable("mid") Integer mid);

    @DeleteMapping("/order/deleteByUid/{uid}")
    int deleteByUid(@PathVariable("uid") Integer uid);

    @GetMapping("/order/findAllByState/{state}/{page}/{limit}")
    OrderVo findAllByState(@PathVariable("state") Integer state, @PathVariable("page") Integer page, @PathVariable("limit") Integer limit);

    @PutMapping("/order/updateState/{id}/{state}/{aid}")
    int updateState(@PathVariable("id") Integer id,@PathVariable("aid") Integer aid,@PathVariable("state") Integer state);
}
